//
//  MPlusFacultyTendencyViewController.m
//  medicineplus
//
//  Created by gufei on 15-5-18.
//  Copyright (c) 2015年 chn_ruby@126.cn. All rights reserved.
//

#import "MPlusFacultyTendencyViewController.h"
#import "MPlusFacultyTendencyTableViewCell.h"
#import "MPlusDefine.h"

@interface MPlusFacultyTendencyViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic, strong) NSMutableArray *aNewsListArray;
@property (nonatomic, retain) UITableView *aTableView;

@end

@implementation MPlusFacultyTendencyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    _aNewsListArray = [@[@"photo_sample_01",
                         @"photo_sample_02",
                         @"photo_sample_03",
                         @"photo_sample_04",
                         @"photo_sample_05",
                         @"photo_sample_06",
                         @"photo_sample_07",
                         @"photo_sample_08",] mutableCopy];
    UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT-148) style:UITableViewStylePlain];
    // 设置tableView的数据源
    tableView.dataSource = self;
    // 设置tableView的委托
    tableView.delegate = self;
    self.aTableView = tableView;
    [self.aTableView registerNib:[UINib nibWithNibName:@"MPlusFacultyTendencyTableViewCell" bundle:nil] forCellReuseIdentifier:@"MPlusFacultyTendencyTableViewCell"];
    [self.view addSubview:self.aTableView];
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
    return _aNewsListArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *cellIdentifier = @"MPlusFacultyTendencyTableViewCell";
    MPlusFacultyTendencyTableViewCell *cell = (MPlusFacultyTendencyTableViewCell*)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
    
    cell.aTitle.text = [NSString stringWithFormat:@"PlayList %ld",(long)indexPath.row];
    cell.aImage1.image = [UIImage imageNamed:_aNewsListArray[indexPath.row]];
    cell.aImage2.image = [UIImage imageNamed:_aNewsListArray[indexPath.row]];
    cell.aImage3.image = [UIImage imageNamed:_aNewsListArray[indexPath.row]];
    
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    //    DetailViewController *detailVC = [[DetailViewController alloc]initWithNibName:@"DetailViewController" bundle:nil];
    //    [self.navigationController pushViewController:detailVC animated:YES];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 122;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
